<div ng-include="sys_html('home/_header',true)"></div>
<style>
.c_customize_container p{font-size:16px;margin:0 auto;line-height:30px}
.c_cust_title{font-size:35px;color:#2d8efe}
.c_customize_container textarea{resize:none}
.c_customize_container form{margin:50px auto;width:65%}
.c_customize_container .form-group{margin-bottom:30px}
.c_customize_container .form-control{height:40px}
.c_customize_container .form-control-textarea{height:auto}
.c_customize_container button{padding:8px 60px;background:#2d8efe;border:none;color:#fff;margin:30px 0}
.c_customize_container button:hover{color:#fff}
</style>
<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true">
		<div class="carousel-inner" role="listbox" style="height:300px">
			<div class="item active">
				<a href="#">
					<img ng-src="{{tomedia(pagedata.account.banner380) || '../core/resource/images/banner-380.jpg'}}" style="display: block; width: 100%; height: auto;"/>
				</a>
			</div>
		</div>
</div>
 <!--需求start  -->
  <div class="text-center c_join_item c_customize_container">
    <div class="c_cust_title">提交您的需求</div>
    <p >马上提交您的需求，我们会在24小时内联系您，提供产品策划服务！</p>
    <form role="form" id='myform'>
      <div class="row">
        <div class="col-md-6 col-xs-12 col-sm-12">
          <div class="form-group">
            <input type="text" class="form-control username"  placeholder="姓名">
          </div>
        </div>
        <div class="col-md-6 col-xs-12 col-sm-12">
          <div class="form-group">
            <input type="tel" class="form-control userphone"  placeholder="手机号码">
          </div>
        </div>
        <div class="col-md-12 col-xs-12 col-sm-12">
          <div class="form-group">
            <input type="text" class="form-control useremail"  placeholder="邮箱">
          </div>
        </div>
        <div class="col-md-12 col-xs-12 col-sm-12">
          <textarea class="form-control form-control-textarea useridear" rows="5" placeholder="示例：我想定制一款电商小程序，有商城的功能，谢谢。"></textarea>
        </div>
      </div>
      <button type="button" class="btn  btn-lg" onclick="Submit()">提交需求</button>
    </form>
	<div ng-include="sys_html('home/_footer',true)"></div>
  </div>
  <!--需求end  -->

<script type="text/javascript">
  function head_nav(){
    $(".c_head_nav").toggle()
  }
  function Submit(){
    var username = $(".username").val();
    var userphone = $(".userphone").val();
    var useremail = $(".useremail").val();
    var useridear = $(".useridear").val();
    var str = /^[1][3,4,5,7,8][0-9]{9}$///手机
    var strname =  /^[\u4e00-\u9fa5]+(·[\u4e00-\u9fa5]+)*$/ //中文
    var stremail = /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
    if(username == ''){
      alert("请输入姓名！")
      return false
    }
    if(!(strname.test(username))){
      alert("请输入中文姓名！")
      return false
    }
    if(userphone == ''){
      alert("请输入手机号码！")
      return false
    }
    if(!(str.test(userphone))){
      alert("请输入正确的手机号码！")
      return false
    }
    if(useremail == ''){
      alert("请输入邮箱！")
      return false
    }
    if(!(stremail.test(useremail))){
      alert("请输入正确的邮箱！")
      return false
    }
    if(useridear == ''){
      alert("请输入需要定制的内容")
      return false
    }
	var params1 = {
					'plugin':'core',
					'action':'home.message',
					'op':'post',
					'data': {name:username,phone:userphone,email:useremail,content:useridear},
					'callback':function(data){
							console.log(data)
							if(data.success == 1){
								 $('#myform')[0].reset();
								 alert('留言成功!');
							}else{
								 alert(data.message);
							}
					}
	}
	scope.post_json(params1);
  }
</script>
